<extend name="Public/base_1"/>


<!-- 子導航 -->
<block name="sidebar">
    <include file="Article/sidemenu" />
</block>

<block name="body">
    <!-- 標題欄 -->
    <div class="main-title">
        <h2>背景圖</h2>
    </div>



    <!-- 數據列表 -->
    <div class="data-table">
        <div class="data-table table-striped">
            <table>
                <!-- 表頭 -->
                <thead>
                    <tr>
                        <th class="row-selected row-selected">
                            <input class="check-all" type="checkbox">
                        </th>
                      
                            <th>編號</th>
                            <th>標題</th>
                            <th>更新時間</th>
                    <th>操作</th>
                    </tr>
                </thead>

                <!-- 列表 -->
                <tbody>
                       <volist name="lists" id="data">
                        <tr>
                            <td><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
                        <td>{$data['id']}</td>
                        <td><a href="{:U('Article/edit',array('id'=>$data['id'],'cate_id'=>$data['cate_id']))}"> {$data['title']}</a></td>
                                    <td>{$data['update_time']|date="y-m-d",###}</td> 
                            <td><a href="{:U('Article/edit',array('id'=>$data['id'],'cate_id'=>$data['cate_id']))}"> 編輯</a></td>          
                        
                        </tr>
               </volist>
                </tbody>
            </table>
        </div>
    </div>
    <div class="page">
        {$_page|default=''}
    </div>
</block>

<block name="script">
<script type="text/javascript">
$(function(){
	//搜索功能
	$("#search").click(function(){
		var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});

    //回車自動提交
    $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
            $("#search").click();
        }
    });

})
</script>
</block>